/* 全局样式重置和基础设置 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 主布局 */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* 侧边栏样式优化 */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}
.nav-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 40px 0 50px 0;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.nav-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 12px 0;
  padding: 16px 24px;
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
/* 主内容区域 */
.main-content {
  flex: 1;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.dashboard-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 40px 0 12px 0;
  letter-spacing: 2px;
  color: #2d3748;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #718096;
  margin-bottom: 40px;
  line-height: 1.6;
  font-weight: 400;
}

.module-placeholder {
  margin: 60px auto;
  font-size: 1.3rem;
  color: #a0aec0;
  text-align: center;
  letter-spacing: 1px;
  font-weight: 500;
}
/* 全局筛选器样式 */
.global-filter-container {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px 32px;
  margin: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: wrap;
}

.global-filter-container label {
  font-weight: 600;
  margin-right: 8px;
  color: #2d3748;
  font-size: 0.95rem;
  white-space: nowrap;
}

.global-filter-container select,
.global-filter-container input[type="date"] {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #fff;
  transition: all 0.3s ease;
  min-width: 120px;
  color: #2d3748;
}

.global-filter-container select:focus,
.global-filter-container input[type="date"]:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.global-filter-container select:disabled {
  background: #f7fafc;
  color: #a0aec0;
  cursor: not-allowed;
}

.global-filter-reset-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.global-filter-reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.global-filter-reset-btn:active {
  transform: translateY(0);
}

.global-filter-error {
  color: #e53e3e;
  margin-left: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* 库存告警模块样式 */
.alarm-filter-bar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px 32px;
  margin: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: wrap;
}
.alarm-filter-bar label {
  font-weight: 600;
  margin-right: 8px;
  color: #2d3748;
  font-size: 0.95rem;
  white-space: nowrap;
}

.alarm-filter-bar select,
.alarm-filter-bar input[type="number"] {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #fff;
  transition: all 0.3s ease;
  min-width: 80px;
  color: #2d3748;
}

.alarm-filter-bar select:focus,
.alarm-filter-bar input[type="number"]:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}
/* 图表容器样式 */
.chart-container {
  display: flex;
  gap: 24px;
  margin: 20px;
  flex-wrap: wrap;
}

.chart-card {
  flex: 1;
  min-width: 300px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.chart-title {
  font-weight: 600;
  margin-bottom: 16px;
  color: #2d3748;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.chart-content {
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
}

/* 告警列表样式 */
.alarm-list-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px 32px;
  margin: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alarm-list-title {
  font-weight: 600;
  margin-bottom: 16px;
  color: #2d3748;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alarm-list-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.alarm-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  color: #2d3748;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  align-items: center;
  border: 1px solid #e2e8f0;
}
.alarm-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: #fff;
  padding: 12px 20px;
  border: 1px solid #f7fafc;
}

.alarm-table-row:hover {
  background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  border-color: #cbd5e0;
}
.alarm-link {
  color: #667eea;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
}

.alarm-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.alarm-link:hover {
  color: #764ba2;
}

.alarm-link:hover::after {
  width: 100%;
}
.alarm-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0 8px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.alarm-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.alarm-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.alarm-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  background: #f7fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.pagination-info {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
}
/* 告警级别样式 */
.level-severe {
  color: #e53e3e;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(229, 62, 62, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(229, 62, 62, 0.2);
}

.level-warn {
  color: #d69e2e;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(214, 158, 46, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(214, 158, 46, 0.2);
}

.level-normal {
  color: #38a169;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(56, 161, 105, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(56, 161, 105, 0.2);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  
  .nav-title {
    font-size: 1.5rem;
    margin: 30px 0 40px 0;
  }
  
  .dashboard-title {
    font-size: 2rem;
  }
  
  .chart-container {
    flex-direction: column;
  }
  
  .chart-card {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 20px;
  }
  
  .nav-section {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .nav-link {
    width: auto;
    margin: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .main-content {
    padding: 20px;
  }
  
  .dashboard-title {
    font-size: 1.8rem;
    margin: 20px 0 10px 0;
  }
  
  .global-filter-container,
  .alarm-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .alarm-table-header,
  .alarm-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .chart-container {
    margin: 10px;
  }
  
  .chart-card {
    padding: 16px;
  }
  
  .chart-content {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .nav-title {
    font-size: 1.3rem;
    margin: 20px 0 30px 0;
  }
  
  .dashboard-title {
    font-size: 1.5rem;
  }
  
  .global-filter-container,
  .alarm-filter-bar,
  .alarm-list-container {
    margin: 10px;
    padding: 16px;
  }
  
  .chart-card {
    padding: 12px;
  }
  
  .chart-content {
    height: 180px;
  }
}

.merged-charts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.merged-charts .chart-content {
  height: 200px;
} 